package com.ibm.risk.irmp.common.audit;

import jakarta.persistence.EntityListeners;
import jakarta.persistence.MappedSuperclass;
import lombok.Data;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import java.time.ZonedDateTime;


/**
 * 支持自动审计字段
 * @author WeiYZZhou
 */
@Data
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public abstract class Auditable extends CreatOnlyAuditable {

    @LastModifiedDate
    private ZonedDateTime updatedAt;

    @LastModifiedBy
    private String updatedBy;

}
